﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace DataChangeTools.Module.Core
{
    public abstract class ModuleBase : IModule
    {

        [Unity.Dependency]
        public IEventAggregator EventAggregator { get; set; }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
        }

        public void OnInitialized(IContainerProvider containerProvider)
        {
            EventAggregator.GetEvent<MessageUpdateEvent>().Publish(new MessageUpdateEvent { Message = GetType().Name });
            ////Sleep for 2 seconds to simulate time consuming module initializaiton
            Thread.Sleep(2000);
        }
    }
}
